package factory;

import org.springframework.beans.factory.FactoryBean;

/**
 * 泛型参数指定的就是此FactoryBean要创建的对象
 */
public class MyFactoryBean implements FactoryBean<UserServiceImplForFactory> {
    @Override
    public UserServiceImplForFactory getObject() throws Exception {
        //100万
        return new UserServiceImplForFactory();


    }

    @Override
    public Class<?> getObjectType() {
        return UserServiceImplForFactory.class;
    }

    @Override
    public boolean isSingleton() {
        //return FactoryBean.super.isSingleton();
        //true表明此bean（指的UserServiceImplForFactory）是单利的
        return true;
    }
}
